package cn.edu.ustc.xrovers.action;

import cn.edu.ustc.xrovers.model.Analyst;
import cn.edu.ustc.xrovers.model.Company;
import cn.edu.ustc.xrovers.model.CompanyRole;
import cn.edu.ustc.xrovers.model.GuaranteeWay;
import cn.edu.ustc.xrovers.model.LoanStatus;
import cn.edu.ustc.xrovers.model.Manager;
import cn.edu.ustc.xrovers.service.UserTest;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 添加用户的测试Action
 * @author paddy
 *
 */
public class InsertTestAction extends ActionSupport{

	private Manager manager;
	private Analyst analyst;
	private Company company;
	private CompanyRole companyRole;
	private GuaranteeWay guaWay;
	private LoanStatus status;
	private UserTest ut;

	/**
	 * 添加分析师的方法
	 * @return
	 * @throws Exception
	 */
	public String insertAnalyst() throws Exception{
		return ut.insertEntity(analyst);
	}
	
	/**
	 * 添加企业用户的方法
	 * @return
	 * @throws Exception
	 */
	public String insertCompany() throws Exception{
		return ut.insertEntity(company);
	}
	
	/**
	 * 添加经理的方法
	 * @return
	 * @throws Exception
	 */
	public String insertManager() throws Exception {
		return ut.insertEntity(manager);
	}
	
	/**
	 * 添加企业角色的方法
	 * @return
	 * @throws Excpetion
	 */
	public String insertCompanyRole() throws Exception{
		return ut.insertEntity(getCompanyRole());
	}
	
	/**
	 * 添加担保方式的方法
	 * @return
	 * @throws Exception
	 */
	public String insertGuaWay() throws Exception{
		return ut.insertEntity(guaWay);
	}
	
	/**
	 * 添加贷款状态的方法
	 * @return
	 * @throws Exception
	 */
	public String insertLoanStatus() throws Exception {
		return ut.insertEntity(status);
	}
	
	
	/*getset方法*/
	public Analyst getAnalyst() {
		return analyst;
	}

	public Company getCompany() {
		return company;
	}
	
	public Manager getManager() {
		return manager;
	}
	
	public UserTest getUt() {
		return ut;
	}
	
	public void setAnalyst(Analyst analyst) {
		this.analyst = analyst;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public void setManager(Manager manager) {
		this.manager = manager;
	}

	public void setUt(UserTest ut) {
		this.ut = ut;
	}

	public void setCompanyRole(CompanyRole companyRole) {
		this.companyRole = companyRole;
	}

	public CompanyRole getCompanyRole() {
		return companyRole;
	}

	public void setGuaWay(GuaranteeWay guaWay) {
		this.guaWay = guaWay;
	}

	public GuaranteeWay getGuaWay() {
		return guaWay;
	}

	public void setStatus(LoanStatus status) {
		this.status = status;
	}

	public LoanStatus getStatus() {
		return status;
	}
}
